package system.model.request;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author 米泽鹏
 * @since 2022-3-13 下午 11:04
 */
@Data
public class SaveRoleAuthorityRequest {

	@NotNull(message = "角色不能为空")
	@Valid
	private Role role;

	@NotNull(message = "权限不能为空")
	@Valid
	private List<Authority> authorityList;

	@Data
	public static class Role {
		@NotNull(message = "角色id不能为空")
		private Long id;
		@NotBlank(message = "角色编码不能为空")
		private String roleCode;
		@NotBlank(message = "角色名称不能为空")
		private String roleName;
	}

	@Data
	public static class Authority {
		@NotNull(message = "权限id不能为空")
		private Long id;
		@NotBlank(message = "权限名称不能为空")
		private String name;
	}

}
